﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using WebSEClassLibrary;

namespace WebSE
{
    public partial class Act3_1 : System.Web.UI.Page
    {
        ActPage actPage;

        protected void Page_Load(object sender, EventArgs e)
        {
            actPage = (ActPage)Session["currentPage"];
            problem.Text = actPage.Problem;

            //设置用户答案
            if (actPage.UserFillAns == null) return;
            blank1.Text = actPage.UserFillAns[0];
        }

        protected void submit(object sender, EventArgs e)
        {
            if (blank1.Text == "") explain.Text = "请输入答案";
            else
            {
                actPage.UserFillAns[0] = blank1.Text;

                explain.Text = "";
                for (int i = 0; i < actPage.CountSimilar[0]; i++)
                {
                    explain.Text += actPage.FillAns[0][i];
                    explain.Text += "    ";
                }
                explain.Text += "<br/>";
                explain.Text += actPage.ExplainFill;
            }
        }
    }
}
